module.exports = app => {
  const { INTEGER } = app.Sequelize;
  const ShoppingCart = app.model.define("shopping_cart", {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    user_id: INTEGER,
    quantity:INTEGER
  });

  ShoppingCart.associate = function () {
    app.model.ShoppingCart.belongsTo(app.model.Commodity, {
      foreignKey: "shop_id",
      as: "shop"
    });
  };

  return ShoppingCart;
};
